//
//  UIScrollView+JTTouch.m
//  RoonenSmartLifeSecondPhase
//
//  Created by sun lei on 16/11/28.
//  Copyright © 2016年 BeiJingWangDianJieTong. All rights reserved.
//

#import "UIScrollView+JTTouch.h"

@implementation UIScrollView (JTTouch)

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    
    if ([self isMemberOfClass:[UIScrollView class]]) {
        
        [[self nextResponder] touchesBegan:touches withEvent:event];
        if ([super respondsToSelector:@selector(touchesBegan:withEvent:)]) {
            [super touchesBegan:touches withEvent:event];
        }
    }
}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    
    if (![self isMemberOfClass:[UIScrollView class]]) {
        
        [[self nextResponder] touchesMoved:touches withEvent:event];
        if ([super respondsToSelector:@selector(touchesBegan:withEvent:)]) {
            [super touchesMoved:touches withEvent:event];
        }
    }
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    
    if ([self isMemberOfClass:[UIScrollView class]]) {
    
        [[self nextResponder] touchesEnded:touches withEvent:event];
        
        if ([super respondsToSelector:@selector(touchesBegan:withEvent:)]) {
            
            [super touchesEnded:touches withEvent:event];
        }
    }
}

@end
